﻿using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace LRT.Nebula.IoC
{
    public static class UnityConfiguration
    {
        public static void Startup(Action<UnityContainer> initAction)
        {
            initAction(Container);
            DependencyResolver.SetResolver(new UnityControllerFactory(Container));
        }
        static UnityContainer container;

        /// <summary>
        /// 注入容器
        /// </summary>
        public static UnityContainer Container
        {
            get
            {
                if (container == null)
                {
                    container = new UnityContainer();
                }
                return container;
            }
        }



    }

}
